<?php

class Kd_Web_Util{

	static public function urlToPath($url){
		return BP.str_replace('/', DS, substr($url, 1));
	}
	
	static public function pathToUrl($path){
		return Kd_Web::getRouter()->getBaseUrl().str_replace(DS, '/', str_replace(BP, '', $path));
	}
	
	static public function urlsToPaths(array $urls){
		$result = array();
		foreach($urls as $url){
			$result[] = self::urlToPath($url);
		}
		return $result;
	}
	
	static public function pathsToUrls(array $paths){
		$result = array();
		foreach($urls as $url){
			$result[] = self::pathToUrl($paths);
		}
		return $result;
	}	
}